Skip to content

fix(ci): recover the manual-plan-pinned DeadlyStream version from its history - #127

Open
bodencrouch wants to merge 21 commits into
mainfrom
fix/deadlystream-pinned-version
Open

bodencrouch wants to merge 21 commits into
mainfrom
fix/deadlystream-pinned-version

Conversation

@bodencrouch

@bodencrouch bodencrouch commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Why

Every finished install lane on #122 stops at observe_k1_bound_model with source_program_archive_identity_changed. Mod authors re-uploaded files on DeadlyStream (K1 Twi'lek Male NPC Diversity moved to v1.2 on 2026-11-18), the archive refresh stored the new bytes as a normal update, and they no longer match the manual plans' archive_sha256 pins. Six files drifted: K1 Twi_lek Male NPC Diversity.7z, Heyorange_s_Sith Uniform_Reformation_Revised.zip (K1); Consistent Bastila Recognition.7z, Darth Sion and Male Exile Mod.7z, PartySwap_EEnclave_ComPatch.7z, TSL Twi_lek Male NPC Diversity.7z (K2).

What

tools/modsync-ci/cache.py now holds DeadlyStream downloads to the manual-plan pins. When the current download's file name is pinned to other bytes, it walks the page's version history (?changelog=<id> → ?do=download&version=<id>), hashes every past version, records each hash in version_history, and keeps the first match under the pinned name.

  • No matching version: the item fails with pinned-version-not-in-history, naming the file and the pin. Unpinned bytes are never stored.
  • A cached object that contradicts a pin is no longer a cache hit or fallback, so a cache already holding the new upload gets corrected.
  • File names with no plan pin behave as before. An unreadable or malformed plan stops the run.

Verification

  • python3 -m unittest discover -s tools/modsync-ci -p 'test_*.py': 1346 tests OK (2 skipped).
  • New test_cache_version_history.py: 12 tests on offline HTML fixtures (recovery, no-match failure, unpinned unchanged, per-version errors recorded, receipt carries the pinned version).
  • Negative gate: with only the download-path pin check disabled, 5 of those tests fail on assertions (wrong sha stored; no failure raised). They pass again once it is restored.
  • Live markup (?changelog= list; ?do=download&version= on a changelog page) was confirmed on the Twi'lek page. The first CI refresh is the live proof.

COMPATIBILITY.md is updated.

Added on 2026-11-24

This branch now also carries CI tooling work beyond the DeadlyStream pin recovery. No Rust source changed.

  • P2P identity per pinned version. tools/modsync-ci/torrent_identity.py creates the BitTorrent v1 info hash and magnet for a pinned archive (bytes plus file name) with the rules of src/p2p.rs::rebuild_single_info. P2P is now two tests: identity (unit tests, plus a per-archive creation step in the archives job that uploads a public p2p-identity receipt) and the two-device loopback, which also requires the real torrent creator to mint the same info hash.
  • Pin files tools/modsync-ci/fixtures/ci/{k1,k2}-p2p-identity.json. They sit beside the manual plans because the plan parser rejects unknown keys. They are empty until a receipt from the archives job is copied in.
  • sample download mode, now the release-candidate default. Per game, one archive source is drawn from the run id and downloaded live; everything else comes from the verified cache. refresh remains selectable. This narrows what a release-candidate run proves about downloads; see COMPATIBILITY.md.
  • Artifact store index warnings name the exception type.
  • docs/ci-workflows.md lists every workflow with its jobs and steps.

Known state: run 45298805484 on a4c64a8 passed the identity, loopback and tooling jobs. Its archives job failed while refreshing every mod: DeadlyStream returned HTTP 403 for 28 sources and one had no cached copy.

https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c


Generated by Claude Code

ci and others added 4 commits November 23, 2026 21:12
… storage

Every install lane (all 12: k1/k2 x cli/gui x three patcher backends) failed
at "Recover and verify the lane-local game baseline", so no patcher lane
ever installed anything and the cross-lane comparison had nothing to compare.

Exhaustive lanes loop-mount a compressed btrfs image as FULLRUN_STORAGE_ROOT.
recover() verified the baseline under RUNNER_TEMP and then renamed the
verified tree into the mount, which crosses filesystems (EXDEV). The broad
OSError handler reported that as "No verified baseline is available".

On EXDEV, restore the same already-verified seal directly at the destination
with verify_seal (unpack + inventory verification), so only freshly verified
bytes are materialized and nothing is copied unverified. Any other OSError
still fails recovery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq
… history

Mod authors re-upload files on DeadlyStream, so the current download no
longer matches the bytes the manual plans pin in archive_sha256, and the
install lanes stop at source_program_archive_identity_changed.

cache.py now loads the k1/k2 manual plans' archive_sha256 once (an
unreadable or malformed plan is an error) and, for a DeadlyStream archive
whose name the plans pin to other bytes, walks the file's ?changelog=<id>
version history newest first, downloading each past version through the
existing request/fetch path and limits until one hashes to the pin. That
object is stored under the pinned name; every version hashed is recorded
in version_history on the entry and report. No match fails the item with
status pinned-version-not-in-history and never keeps the unpinned bytes;
a cached object that conflicts with a pin is no longer a cache hit.
Unpinned names are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq
…he install stage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq

Copy link
Copy Markdown
Owner Author

This PR's install lanes failed at the baseline step ("No verified k1 baseline"). That's the cross-filesystem (EXDEV) bug #122 fixes; this branch was cut from main before #122.

#122's own lanes, meanwhile, fail on the DeadlyStream drift this PR fixes. So neither PR could go green alone.

To break that, I merged #122's head (53e9d9c) into this branch (a9bcab5). It's a plain merge with no history rewritten, and it touches only fullrun_baseline.py and its test. The Python suite passes on the merged tree (1,348 tests OK). This run now exercises both fixes end to end.

Planned merge order once green: #122, then this PR.

Separately, the last archives job failed for reasons outside this diff: the archive-store index didn't load (cache.py:2065), and DeadlyStream returned HTTP 403 to some sources. The version-history recovery itself worked against live DeadlyStream pages for 4 of the 6 drifted files. For example, K1 Twi_lek Male NPC Diversity.7z was recovered at v1.1.7, f5da0ee1…, which is its pin.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

The install (k2, gui, ody-patcher) lane on a9bcab5 (#127 with #122 merged in) shows progress and a new blocker.

Progress: the lane got past Recover and verify the lane-local game baseline, so the cross-filesystem fix from #122 works here.

New blocker: the install step fails at ports: bind_archives (exit 1, after about 3m52s):

Error: UCO prerequisite differs from its complete compiled original definition
ports: archive binding bound 0 component(s); not used: bind_archives_failed

That message comes from src/archive_generation/reviewed_master/uco.rs:221. It means one of the guide components that UCO lists as a prerequisite (resolved through source_definition) no longer equals the definition compiled into the binary (a.source.components[index]). The guide is pinned to kolto-labs/mod-builds@67dc5fd in .github/fullrun.json, so the guide text itself didn't move.

Earlier runs never reached this step: they stopped sooner, at the baseline or the archive-identity check. So I can't yet tell whether this mismatch was always there or comes from #127 recovering older DeadlyStream versions. The error doesn't say which prerequisite failed. Finding it means diffing each spec.priors component in the bound guide against the compiled snapshot. That's the next investigation; it's not fixed in this PR yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq


Generated by Claude Code

ci and others added 8 commits November 24, 2026 00:36
The two artifact store index failure paths in cache.py warned without saying
what failed. They now include the exception type only, never its message,
which could carry a URL. Covered by a new test in test_cache.py.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
A pinned version is its archive bytes plus its file name. torrent_identity.py
derives the BitTorrent v1 info hash and magnet for that pair with the rules of
src/p2p.rs::rebuild_single_info, so the same pinned version always maps to the
same info hash.

P2P is now two separate tests:
- identity: test_torrent_identity.py recreates five info hashes the production
  CLI rebuilds, validates the pin files and all pinned file names; the archive
  stage creates the identity of every pinned version it holds verified bytes
  for and uploads a public receipt.
- transfer: the two-device loopback, which now also requires the pinned
  torrent creator to mint the same info hash as torrent_identity.py.

Pins live in fixtures/ci/{k1,k2}-p2p-identity.json because the manual-plan
parser rejects unknown keys. They start empty: no real archive bytes were
available, so the first archive-stage receipt is the source for them.
Every pinned magnet must carry its name (dn).

No Rust source changed and no Rust tests were run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
docs/ci-workflows.md gives an itemized list of the 17 workflows (name, file,
trigger, purpose) and, for each job, its dependencies and step names in
order. The step lists are generated from the workflow files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
For each game the archive stage draws one archive source from the run id and
attempt, restores it with a live provider attempt, then restores everything
from the verified cache. The stage fails unless that attempt is on record.

Release candidates default to sample instead of refresh, so a run no longer
asks DeadlyStream and Nexus for every archive. refresh stays selectable and
still satisfies the release gate; cache-first still does not. This narrows
what a release-candidate run proves about downloads to one drawn source per
game, recorded in COMPATIBILITY.md.

No Rust source changed and no Rust tests were run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
Run 45298805484 refreshed every mod, DeadlyStream answered HTTP 403 for 28
sources and one had no cached copy, so the archive stage failed and the
identity step was skipped. Bytes already verified in the object cache keep
their identity, so the step now also runs after a failed acquisition.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
Copied from the public p2p-identity receipt of run 45303323274 (commit
cdc8710): 106 of 200 K1 and 85 of 159 K2 pinned versions. Each entry was
validated against its manual plan (SHA-256, file name, magnet with dn). The
remaining 94 and 74 had no verified bytes in that run's object cache.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
The sample download mode now draws exactly one archive source per run across
all requested games, so a both-games run downloads one mod live instead of
two. The validation requires exactly that one attempt.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
Two exhaustive runs created identities for only 191 of 359 pinned versions:
the workflow step ran after the stage had already trimmed the object cache
to its bound. The stage now writes the public receipts itself just before
that trim, and the workflow step reads them, falling back to a survey of
the remaining objects when the stage stopped earlier.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c

Copy link
Copy Markdown
Owner Author

CI status on this branch, from full-runs 45303323274 (cdc8710) and 45312276943 (94a81be).

Passing: plan, tooling contracts, both game baselines, both production builds, archives, P2P identity, P2P two-device loopback.

Install lanes fail in the Rust engine, past the point this PR set out to fix. The original failure, source_program_archive_identity_changed at observe_k1_bound_model for K1 Twi'lek Male NPC Diversity, no longer appears in the K1 lane log, so the lanes now get further and stop on other things:

  • K1 (install (k1, cli, ody-patcher), job 138181490765), blocked at guide_selection:
    • Stunbaton HD and Zaalbar HD: "Reviewed manual file effects remain unresolved: Component differs from exact reviewed recipe context"
    • Taris Rapid Transit: "Source-plan selected namespace owner remains unresolved: Selected namespace has unclassified inactive sections"
  • K2 (three lanes, for example job 138181490907), blocked at bind_archives: "UCO prerequisite differs from its complete compiled original definition" (src/archive_generation/reviewed_master/uco.rs).

No earlier run on any branch reached these stages, so whether they are new is not known. They are engine and guide parity matters; this PR changes only Python CI tooling, workflows and docs, and does not address them.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c


Generated by Claude Code

ci and others added 6 commits November 24, 2026 04:32
Copied from the public p2p-identity receipt of run 45322164517 (commit
f639619), the first run that created identities before the cache trim: 93
more K1 and 73 more K2 versions, each validated against its manual plan.
199 of 200 K1 and 158 of 159 K2 versions are now pinned. The same run
recreated all 191 earlier pins and each matched.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
Output redaction replaces the value of every secret-named environment
variable. On a host where such a variable holds a short value such as "1",
three test_ports tests failed because the digits they assert on were
rewritten. The module now removes secret-named variables for its duration.
No assertion changed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
The pinned-version recovery was keyed by archive file name, so a re-upload
under a new name was stored as an ordinary update: 544-partyswap serves
PartySwap 1.6.1.7z while the K2 plan pins PartySwap 1.5.7z. An unpinned file
name on a single-file page is now linked to the one plan pin with the same
name once version and extension are ignored, if that pin is not already in
the cache, and the version history is walked for it.

The link is a guess, so a pin missing from the history keeps the current
upload as before and records the search instead of failing the item.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
…r cause

K1 install lanes stopped with "Component differs from exact reviewed recipe
context" for Stunbaton HD and Zaalbar HD. The recipe book still embedded
options the draft produced before negated recommendations stopped becoming
options. Recipes 32 and 41 now hold the components the engine drafts today;
the book hash and the master data hash that pin them are updated in the
five places that carry them.

The UCO prerequisite refusal now names the prerequisite and its differing
fields, and the unclassified inactive sections refusal lists the sections.
Both causes remain open; the messages are what the next run needs.

Checked: fmt, build and clippy without default features; all 66 recipes'
raw and canonical components equal the built engine's output for the
compiled guide. No Rust tests were run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
Run 45329233118 (commit 8eb1cef) walked the renamed upload's version
history, restored the pinned PartySwap 1.5.7z and created its identity.
All 159 K2 versions and 199 of 200 K1 versions are now pinned. The same run
recreated the 357 earlier pins and each matched.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c
K2 install lanes stopped at bind_archives because The Sith Lords Restored
Content Mod, a UCO prerequisite, is rewritten by the vendor installer
binding (Instructions and VendorInstallerBinding), and the comparison with
the compiled original could recover the original definition from three
other generators but not from this one. The binding already stores its
reviewed input component; the comparison now uses it, admitted only while
it still equals the reviewed context.

Definition comparison only, never proof that the installer ran. Checked:
fmt, build and clippy without default features. No Rust tests were run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c

Copy link
Copy Markdown
Owner Author

Update on the install-lane failures described above, from full-run 45329233118 (8eb1cef) and the commits since.

  • K1 Stunbaton HD and Zaalbar HD: fixed and confirmed in CI. The recipe book in the engine still embedded options that the draft stopped producing. After 8eb1cef the K1 lane no longer reports them.
  • K2 "UCO prerequisite differs": cause found, fix pushed in 69916fa, not yet confirmed. The new diagnostic named The Sith Lords Restored Content Mod, differing in Instructions and VendorInstallerBinding. The UCO definition comparison could not recover the original of a vendor-bound component; it now uses the input the binding stores.
  • PartySwap: fixed and confirmed in CI. DeadlyStream had replaced the pinned PartySwap 1.5.7z with PartySwap 1.6.1.7z under a new name. The archive stage now walks the history for a renamed upload and restored 1.5.
  • K1 Taris Rapid Transit: still open. Selected namespace has unclassified inactive sections now lists them: several hundred gff_m02ab_* and gff_m02ac_* sections (TweakColor, UseTweakColor, Placeable List, Bearing, TemplateRes and others). Classifying them is a reviewed engine decision keyed on the archive and INI hashes, and needs the mod's changes.ini.

P2P identities: all 159 K2 versions and 199 of 200 K1 versions are pinned. The one left is K1 Heyorange_s_Sith Uniform_Reformation_Revised.zip, whose page now serves a reviewed .7z revision.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c


Generated by Claude Code

…quisite

Run 45337846523 confirmed the vendor-bound prerequisite now compares equal
and stopped at the next one, Maintenance Officer Realistic Reskin, which
the archive method binding rewrites (ArchiveMethodBinding and
Instructions). The comparison now restores the method-only component that
binding was made from, admitted only if the result is method-only again.

The refusal reports every differing prerequisite at once, so one run shows
all that remain.

Definition comparison only. Checked: fmt, build and clippy without default
features. No Rust tests were run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c

Copy link
Copy Markdown
Owner Author

Update from full-run 45345487859 (91188b9).

K2 "UCO prerequisite differs": fixed and confirmed. The refusal no longer appears. K2 lanes now pass bind_archives for Ultimate Character Overhaul's prerequisites and, for the first time, reach accept_drafts, the same stage the K1 lanes stop at.

What stops the lanes now is the engine's remaining coverage of individual mods. Each is a separate, reviewed engine decision and none is addressed by this PR.

K2 (job install (k2, gui, mod-packaged)), 14 components not installed; the reported reasons:

Mod Reason
Alignment Affects Force Powers, Improved Force Sight Original NSS input exceeds raw bound
Ebon Hawk Downloadable Map, TSL Galaxy Map Fix Pack Selected namespace has unclassified inactive sections
Fixed Hologram Models & Admiralty Redux, Thematic Sith Lords Selected namespace configured source needs a supported current loose/module resource
HQ Skyboxes II Original program aggregate expansion bound exceeded
Mines Overhaul Original compiler header differs from known actual game
Peragus Medical Bay Enhancement, Transparent Cockpit Windows TSL Destination resource needs a bounded MOD V1.0 snapshot
Sith Assassins with Lightsabers No such file or directory (os error 2)
Visually Repair HK-47 Selected INI graph exceeds bound

Ultimate Character Overhaul Patches is then skipped because Fixed Hologram Models is not installed.

K1: Taris Rapid Transit only (unclassified inactive sections), as in the previous comment.

Everything outside the install lanes passes on this head: plan, tooling contracts, production parity gates, game baselines, production builds, archives, P2P identity and the P2P loopback.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c


Generated by Claude Code

torrent_identity survey --write-pins re-validates the merged pins before
writing them. A refusal there escaped as a traceback, because only OSError
was caught around the write. It now prints one line and exits 1 with the pin
file untouched, like every other failure of the tool. CI does not use
--write-pins; this affects manual runs. Covered by a new test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDKiop2EihVsnJdm1ecw7c

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants